<?php $this->load->view('home/layout/header') ?>
<form action="<?php echo site_url('home/passenger/editPost'); ?>" method="post" id="form-passenger" >
	<header class="my-head flex">
		<div class="my-return">
			<a href="<?php echo site_url('home/passenger/passengerList') ?>">
				<i class="iconfont icon-zuojiantou"></i>
			</a>
		</div>
		<div class="add-name">
			编辑常用联系人
		</div>
		<div class="add-submit">
			<button type="submit">保存</button>
		</div>
	</header>
	<section class="add-text widthMax">
		<input type="hidden" name="visitor_id" value="<?php echo $info->visitor_id; ?>" >
		<ul>
			<li>
				<h6>真实姓名</h6>
				<div class="add-input flex-1">
					<input type="text" name="visitor_name" placeholder="确保与证件保持一致" value="<?php echo $info->visitor_name; ?>" >
				</div>
			</li>
			<li class="add-choice">
				<input type="hidden" name="sex" value="<?php echo $info->sex; ?>">
				<a href="javascript:;" class="flex" data-am-modal="{target: '#passenger-sex'}">
					<p class="flex-1">性别</p>
					<div class="my-photo flex">
						<div class="photo-text flex-1" id="sex">
							<?php echo $info->sex == 1 ? '男' : '女'; ?>
						</div>
						<i class="iconfont icon-youjiantou"></i>
					</div>
				</a>
			</li>
			<li class="add-choice">
                <input type="hidden" name="type" value="<?php echo $info->type; ?>">
				<a href="javascript:;" class="flex" data-am-modal="{target: '#passenger-type'}">
					<p class="flex-1">证件类型</p>
					<div class="my-photo flex">
						<div class="photo-text flex-1" id="pin-type">
							<?php
							switch ($info->type) {
								case 1 :
									echo '身份证';
									break;
								case 2 :
									echo '护照';
									break;
								case 3 :
									echo '军官证';
									break;
								default:
									echo '其它';
									break;
							}
							?>
						</div>
						<i class="iconfont icon-youjiantou"></i>
					</div>
				</a>
			</li>
			<li>
				<h6>证件号码</h6>
				<div class="add-input flex-1">
					<input type="text" name="pin" placeholder="证件号码" value="<?php echo $info->pin; ?>" >
				</div>
			</li>
			<li>
				<h6>手机号码</h6>
				<div class="add-input flex-1">
					<input type="tel" name="mobile_phone" placeholder="11位手机号" value="<?php echo $info->mobile_phone; ?>" >
				</div>
			</li>
		</ul>
		<div class="add-delete">
			<a href="javascript:;" id="passenger-remove" data-id="<?php echo $info->visitor_id; ?>">
				<i class="iconfont icon-shanchu"></i>
				<p>删除</p>
			</a>
		</div>
	</section>
</form>

<?php if ($info->default != 1) : ?>
<div class="add-give">
	<a href="<?php echo site_url('home/passenger/setDefault/'. $info->visitor_id); ?>">
		<p>设为默认地址</p>
	</a>
</div>
<?php endif; ?>

<div class="am-modal alert-explain" tabindex="-1" id="my-confirm">
	<div class="am-modal-dialog">
		<div class="am-modal-bd">
			确实删除该联系人吗？
		</div>
		<div class="am-modal-footer">
			<span class="am-modal-btn" data-am-modal-cancel>取消</span>
			<span class="am-modal-btn" data-am-modal-confirm>确定</span>
		</div>
	</div>
</div>


<div class="sex-alert am-modal-actions" id="passenger-sex">
	<div class="sex-ul">
		<ul>
			<li data-type="1">男</li>
			<li data-type="2">女</li>
		</ul>
	</div>
	<div class="sex-close">
		<button data-am-modal-close>取消</button>
	</div>
</div>

<div class="sex-alert am-modal-actions" id="passenger-type">
	<div class="sex-ul">
		<ul>
			<li data-type="1">身份证</li>
			<!--  		<li data-type="2">护照</li>-->
			<!--  		<li data-type="3">军官证</li>-->
		</ul>
	</div>
	<div class="sex-close">
		<button data-am-modal-close>取消</button>
	</div>
</div>

<?php $this->load->view('home/layout/footer'); ?>